/**
 * 
 */
package GUI.main.navigation;

import java.awt.Dimension;

import javax.swing.JPanel;

import OfficeServer.users.AccessLevel;
import OfficeServer.users.User;

/**
 * JPanel to be placed in the main layout--takes in user to determine type of
 * layout.
 * 
 * @author mramsey3
 * 
 */
public class NavigationMenuPanel extends JPanel {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    
    private PatientNavigationMenuPanel patientNavigationMenuPanel;
    private DoctorNavigationMenuPanel doctorNavigationMenuPanel;
    private NurseNavigationMenuPanel nurseNavigationMenuPanel;
    private AdminNavigationMenuPanel adminNavigationMenuPanel;

    /**
     * @param user
     */
    public NavigationMenuPanel(User user) {
	super();
	setPreferredSize(new Dimension(200,450));
	switch (user.getAccessLevel()) {
	case PATIENT:
	    add(getPatientNavigationMenuPanel());
	    break;
	case DOCTOR:
	    add(getDoctorNavigationMenuPanel());
	    break;
	case NURSE:
	    add(getNurseNavigationMenuPanel());
	    break;
	case ADMIN:
	    add(getAdminNavigationMenuPanel());
	    break;
	}
    }

    /**
     * @author mramsey3
     * @return
     */
    public PatientNavigationMenuPanel getPatientNavigationMenuPanel() {
	if (patientNavigationMenuPanel == null) {
	    patientNavigationMenuPanel = new PatientNavigationMenuPanel();
	}
	return patientNavigationMenuPanel;
    }

    /**
     * @author mramsey3
     * @param patientNavigationMenuPanel
     */
    public void setPatientNavigationMenuPanel(
	    PatientNavigationMenuPanel patientNavigationMenuPanel) {
	this.patientNavigationMenuPanel = patientNavigationMenuPanel;
    }

    /**
     * @author mramsey3
     * @return
     */
    public DoctorNavigationMenuPanel getDoctorNavigationMenuPanel() {
	if(doctorNavigationMenuPanel == null){
	    doctorNavigationMenuPanel = new DoctorNavigationMenuPanel();
	}
	return doctorNavigationMenuPanel;
    }

    /**
     * @author mramsey3
     * @param doctorNavigationMenuPanel
     */
    public void setDoctorNavigationMenuPanel(
	    DoctorNavigationMenuPanel doctorNavigationMenuPanel) {
	this.doctorNavigationMenuPanel = doctorNavigationMenuPanel;
    }

    /**
     * @author mramsey3
     * @return
     */
    public NurseNavigationMenuPanel getNurseNavigationMenuPanel() {
	if(nurseNavigationMenuPanel == null){
	    nurseNavigationMenuPanel = new NurseNavigationMenuPanel();
	}
	return nurseNavigationMenuPanel;
    }

    /**
     * @author mramsey3
     * @param nurseNavigationMenuPanel
     */
    public void setNurseNavigationMenuPanel(
	    NurseNavigationMenuPanel nurseNavigationMenuPanel) {
	this.nurseNavigationMenuPanel = nurseNavigationMenuPanel;
    }

    /**
     * @author mramsey3
     * @return
     */
    public AdminNavigationMenuPanel getAdminNavigationMenuPanel() {
	if(adminNavigationMenuPanel == null){
	    adminNavigationMenuPanel = new AdminNavigationMenuPanel();
	}
	return adminNavigationMenuPanel;
    }

    /**
     * @author mramsey3
     * @param adminNavigationMenuPanel
     */
    public void setAdminNavigationMenuPanel(
	    AdminNavigationMenuPanel adminNavigationMenuPanel) {
	this.adminNavigationMenuPanel = adminNavigationMenuPanel;
    }
}
